package com.lkbaby.home.controller.impl;

import com.lkbaby.home.controller.BannerController;
import com.lkbaby.home.entity.Banner;
import com.lkbaby.home.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * (Banner)表控制层
 *
 * @author makejava
 * @menu banner
 * @since 2022-09-21 09:41:53
 */
@CrossOrigin
@RestController
@RequestMapping("/banner")
public class BannerControllerImpl implements BannerController {

	@Autowired
	private BannerService bannerService;

	/**
	 * 查询Banner信息
	 *
	 * @return Banner信息
	 */
	@Override
	@RequestMapping("/queryBanner")
	public Banner queryBanner() {
		return bannerService.queryBanner();
	}

	/**
	 * 更新Banner信息
	 *
	 * @param banner banner信息
	 * @return 更新状态
	 */
	@Override
	@RequestMapping("/update")
	public boolean updateBanner(@RequestBody Banner banner) {
		return bannerService.updateBanner(banner);
	}
}

